package com.cryptoneedle.center.repository.ods;

import com.bubbles.engine.data.core.repository.BaseRepository;
import com.cryptoneedle.center.common.entity.ods.OdsTable;
import com.cryptoneedle.center.common.key.TableKey;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>description: Ods-Table </p>
 *
 * @author CryptoNeedle
 * @date 2025-09-25
 */
@Repository
public interface OdsTableRepository extends BaseRepository<OdsTable, TableKey> {

    @Query("FROM OdsTable ORDER BY catalogName, databaseName, tableName")
    List<OdsTable> list();

    @Query("FROM OdsTable WHERE catalogName = :catalogName AND databaseName = :databaseName ORDER BY catalogName, databaseName, tableName")
    List<OdsTable> listByDatabase(String catalogName, String databaseName);
}